package ${package.ServiceImpl};

import cn.hutool.core.bean.BeanUtil;
import ${package.Entity}.${entity};
import ${cfg.controllerPackage}.dto.${entity}Dto;

import ${package.Service}.${table.serviceName};
import ${superServiceImplClassPackage};
import ${package.Mapper}.${table.mapperName};
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.AbstractWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.sbtr.common.PageDto;
import com.sbtr.util.PageDtoUtils;
import org.springframework.transaction.annotation.Transactional;

/**
 * ${table.comment!} Service接口实现类
 *
 * @author ${author}
 * @since  ${date}
 */
@Transactional
@Service
public class ${table.serviceImplName} extends ${superServiceImplClass}<${table.mapperName},${entity}> implements ${table.serviceName} {

    @Autowired
    ${table.mapperName} ${'${table.mapperName}'?uncap_first};

    @Override
    public PageDto<${entity}> pageList(${entity}Dto ${'${entity}'?uncap_first}Dto) {

        IPage<${entity}> page = new Page<>();
        page.setSize(${'${entity}'?uncap_first}Dto.getPageSize());
        page.setCurrent(${'${entity}'?uncap_first}Dto.getPage());
        page = ${'${table.mapperName}'?uncap_first}.selectPages(page, BeanUtil.beanToMap(${'${entity}'?uncap_first}Dto));
        PageDto<${entity}> r = PageDtoUtils.getPageDtoByIPage(page, ${entity}.class);

        return r;
    }
}

